# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@pybind11_bazel//:build_defs.bzl", "pybind_library")

package(default_visibility = ["//visibility:public"])

pybind_library(
    name = "phe_binding",
    srcs = ["bind_phe.cc"],
    hdrs = ["bind_phe.h"],
    deps = [
        ":py_encoders",
        "//heu/library/phe",
        "//heu/pylib/common:py_utils",
    ],
)

pybind_library(
    name = "py_encoders",
    hdrs = [
        "py_encoders.h",
    ],
    deps = [
        ":py_batch_encoder",
        ":py_bigint_encoder",
        ":py_float_encoder",
        ":py_integer_encoder",
    ],
)

pybind_library(
    name = "py_batch_encoder",
    srcs = ["py_batch_encoder.cc"],
    hdrs = ["py_batch_encoder.h"],
    deps = [
        "//heu/library/phe/encoding",
        "//heu/pylib/common:py_utils",
    ],
)

pybind_library(
    name = "py_bigint_encoder",
    srcs = ["py_bigint_encoder.cc"],
    hdrs = ["py_bigint_encoder.h"],
    deps = [
        "//heu/library/phe/encoding",
        "//heu/pylib/common:py_utils",
    ],
)

pybind_library(
    name = "py_float_encoder",
    srcs = ["py_float_encoder.cc"],
    hdrs = ["py_float_encoder.h"],
    deps = [
        "//heu/library/phe/encoding",
        "//heu/pylib/common:py_utils",
    ],
)

pybind_library(
    name = "py_integer_encoder",
    srcs = ["py_integer_encoder.cc"],
    hdrs = ["py_integer_encoder.h"],
    deps = [
        "//heu/library/phe/encoding",
        "//heu/pylib/common:py_utils",
    ],
)
